#include "crossbit/VBasicBlockBuilder.h"
#include "crossbit/VBlock.h"

using namespace crossbit;

void VBasicBlockBuilder::add(VInst *inst)
{
				// "A dynamic basic block always begins at the instruction executed
				// immediately after a branch or jump, follows the sequential instruction
				// stream, and ends with the next branch or jump."
				//	quoted from VM-VPSP, page 57
				if ( 	inst->getOpcode() == OP_SYSCALL ||
							inst->getOpkind() == OPK_CONTROLTRANSFER ||
							inst->getOpcode() == OP_HALT )
								bb_end = true;

				bb_vblock->push_back(inst);
}

